package com.gitee.wsl.common.ui.base

import androidx.compose.ui.geometry.Rect

/**
 * A [RectWithHandlers] is a [Rect] shape with handlers to indicate how to manipulate it.
 * It can have vertical or horizontal handlers (to display that the rect can be extended vertically or horizontally) or
 * it can have handlers at the corners to indicate that the rect can be extended in both dimensions.
 *
 * @param rect the rectangle shape, in a chart-relative position
 * @param handlersPosition the positions of the handlers
 * @param handlersCenter the reference of the handlers, it is used mainly for Vertical and Horizontal handlers
 */
 data class RectWithHandlers(
    val rect: Rect,
    val handlersPosition: HandlersPosition,
    val handlersCenter: Point
)

/**
 * Store the position of the handlers.
 */
 enum class HandlersPosition {

    /**
     * Handlers are at the top and the bottom of the rect
     */
    Vertical,

    /**
     * Handlers are at the left and the right of the rect
     */
    Horizontal,

    /**
     * Handlers are at the 4 corners of the rect
     */
    Corners,

    /**
     * No handlers
     */
    None
}